/*
 ============================================================================
 Name		: ResponseSort.cpp
 Author	  : 
 Version	 : 1.0
 Copyright   :
 Description : CResponseSort implementation
 ============================================================================
 */

#include "ResponseUserBalanceAmount.h"
#include "ResponseDefinses.h"
#include "ProjectsDefines.h"
#include "ResponseSortData.h"
#include "ResponseMagazineItemData.h"
#include "BetterUserHBufC.h"

CResponseUserBalanceAmount::CResponseUserBalanceAmount( )
{
    // No implementation required
}

CResponseUserBalanceAmount::~CResponseUserBalanceAmount( )
{
    SAFE_DELETE( _balance_amount );
}

CResponseUserBalanceAmount* CResponseUserBalanceAmount::NewLC( )
{
    CResponseUserBalanceAmount* self = new ( ELeave ) CResponseUserBalanceAmount( );
    CleanupStack::PushL( self );
    self->ConstructL( );
    return self;
}

CResponseUserBalanceAmount* CResponseUserBalanceAmount::NewL( )
{
    CResponseUserBalanceAmount* self = CResponseUserBalanceAmount::NewLC( );
    CleanupStack::Pop( ); // self;
    return self;
}

void CResponseUserBalanceAmount::ConstructL( )
{

}

void CResponseUserBalanceAmount::LoadValidResponseFromXmlNode( CElement* elementResponse )
{
    _ASSERT_LOG( elementResponse != NULL );

    if( !elementResponse )
    {
        return;
    }

    CElement* elementResult = elementResponse->GetElement( kResponseResultNode );

    _ASSERT_LOG( elementResult != NULL );
    if( !elementResult )
    {
        return;
    }
    _LIT( kResponseBalanceAmountNode, "balance_amount" );

    CElement* element = elementResult->GetElement( kResponseBalanceAmountNode );
    _balance_amount = BetterUtility::GetElementText( element );
}
